function calculate() {
  let g = 9.8

  var input1 = parseFloat(document.getElementById("input1").value);   //f
  var input2 = parseFloat(document.getElementById("input2").value);   //n
  var input3 = parseFloat(document.getElementById("input3").value);  //s1
  var input4 = parseFloat(document.getElementById("input4").value); //s2
  //console.log("input1", input1);

  //console.log("input2", input2);
  //console.log("input3", input3);
  // console.log("input4", input4);

  if (!input1) {
    input1 = 0;
  }
  if (!input2) {
    input2 = 0;
  }
  if (!input3) {
    input3 = 0;
  }
  if (!input4) { input4 = 0; }

  var result = ((input3 + input4) / (input1 * input2) * 3.6).toFixed(2);
  var result1 = ((input3 + input4) / (input1 * input2)).toFixed(2);
  if (result == 'NaN') {
    result = 0
    alert('请按要求输入数据！')
    location.reload()
  }

  document.getElementById("result").textContent = result;
  document.getElementById("result1").textContent = result1;
}